#ifndef __NET_COMM_H__
#define __NET_COMM_H__

#include <iostream>                              
#include <unistd.h>                              
#include <sys/socket.h>                          
#include <arpa/inet.h>                           
#include <string.h>                              
#include <errno.h>   
#include <fcntl.h>
                            
#define TCP_TX_BUF_MAX	40                        
#define TCP_RX_BUF_MAX	40                        
#define DATA_WIDTH    4                          
#define APP_NULL         0                       
#define PTCL_DATA_MAX       8   
                 
#define NET_HEAR            0                    
#define NET_DTX_1           1                    
#define NET_DTX_2           2                    
#define NET_DTX_3           3                    
#define NET_DTX_4           4                    
#define NET_DTX_5           5                    
#define NET_DTX_6           6                    
#define NET_DTX_7           7                    
#define NET_DTX_8           8                    
#define NET_CHKS            9                    
#define NET_FRAME_HEADER    '$'                  
                                    
void net_tcp_open(void);                         
void net_tcp_close(void) ; 

unsigned int net_tcp_read(unsigned char *cmd, unsigned char *idx, unsigned char *ste, float dtx[6]);                      
unsigned int net_tcp_write(unsigned char cmd, unsigned char idx, unsigned char ste, float dtx[8]);

#endif //__NET_COMM_H__
